﻿<html DIR="LTR" xmlns:tool="http://www.microsoft.com/tooltip" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ddue="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
  <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8" />
    <META NAME="save" CONTENT="history" />
    <title>International Features of the JDBC Driver</title>
    
    <link rel="stylesheet" type="text/css" href="../local/Classic.css">
      
    </link>
    
    <script src="../local/script.js">
      
    </script><script src="../local/script_main.js">&amp;nbsp;</script>
  </head>
  <body>
    <!--Topic built:03/26/2010 02:49:39-->

    
    
    
    
    
    
    
    
    
    <div id="header">
      <table width="100%" id="topTable"><tr>
          <td align="left">
            <span id="headerBold">International Features of the JDBC Driver</span>
          </td>
          <td align="right">
            
          </td>
        </tr></table>
      
      
      
    </div>
    <div id="mainSection">
      
        
        
    <font color="DarkGray">
      
    </font>
    <p />
    
    <p />
  
        <div id="introductionSection" class="section">
    <p>The internationalization features of the Microsoft SQL Server JDBC Driver include the following: </p>
    <ul><li>
        Support for a fully localized experience in the same languages as SQL Server.<br />
      </li><li>
        Support for the Java language conversions for locale sensitive SQL Server data.<br />
      </li><li>
        Support for international languages, regardless of operating system.<br />
      </li></ul>
  </div><h1 class="heading">Handling of Character Data</h1><div id="sectionSection0" class="section"><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">Character data in Java is handled as Unicode by default; the Java <b>String</b> object represents Unicode character data. In the JDBC driver, the only exception to this rule is the ASCII stream getter and setter methods, which are special cases because they use byte streams with the implicit assumption of single well-known code pages (ASCII).</p>
      <p xmlns="">In addition, the JDBC driver provides the <b>sendStringParametersAsUnicode</b> connection string property. This property can be used to specify that prepared parameters for character data are sent as ASCII or Multi-byte Character Set (MBCS) instead of Unicode. For more information about the <b>sendStringParametersAsUnicode</b> connection string property, see <a href="f1b62700-f046-488d-bd6b-a5cd8fc345b7.htm">Setting the Connection Properties</a>. </p>
    </content><sections xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <h1 class="heading" xmlns="">Driver Incoming Conversions</h1><div id="sectionSection" class="section" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
          <p xmlns="">Unicode text data coming from the server does not have to be converted. It is passed directly as Unicode. Non-Unicode data coming from the server is converted from the code page for the data, at the database or column level, to Unicode. The JDBC driver uses the Java Virtual Machine (JVM) conversion routines to perform these conversions. These conversions are performed on all typed String and Character stream getter methods.</p>
          <p xmlns="">If the JVM does not have the proper code page support for the data from the database, the JDBC driver throws a "XXX codepage not supported by the Java environment" exception. To solve this problem, you should install the full international character support required for that JVM. For an example, see the Supported Encodings documentation on Sun Microsystems Web site.</p>
        </content></div>
      <h1 class="heading" xmlns="">Driver Outgoing Conversions</h1><div id="sectionSection" class="section" xmlns=""><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
          <p xmlns="">Character data going from the driver to the server can be ASCII or Unicode. For example, the new JDBC 4.0 national character methods, such as <b>setNString</b>, <b>setNCharacterStream</b>, and <b>setNClob</b> methods of <a href="a8481c06-fbba-432b-8c69-4f4619c20ad4.htm">SQLServerPreparedStatement</a> and <a href="30710a63-c05d-47d9-9cf9-c087a1c76373.htm">SQLServerCallableStatement</a> classes, always send their parameter values to the server in Unicode.</p>
          <p xmlns="">On the other hand, the non-national character API methods, such as <b>setString</b>, <b>setCharacterStream</b>, and <b>setClob</b> methods of <a href="a8481c06-fbba-432b-8c69-4f4619c20ad4.htm">SQLServerPreparedStatement</a> and <a href="30710a63-c05d-47d9-9cf9-c087a1c76373.htm">SQLServerCallableStatement</a> classes send their values to the server in Unicode only when the <b>sendStringParametersAsUnicode</b> property is set to "true", which is the default value. </p>
        </content></div>
    </sections></div><h1 class="heading">Non-Unicode Parameters</h1><div id="sectionSection1" class="section"><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">For optimal performance with <b>CHAR</b>, <b>VARCHAR</b> or <b>LONGVARCHAR</b> type of non-Unicode parameters, set the <b>sendStringParametersAsUnicode</b> connection string property to "false" and use the non-national character methods.</p>
    </content></div><h1 class="heading">Formatting Issues</h1><div id="sectionSection2" class="section"><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">For date, time, and currencies, all formatting with localized data is performed at the Java language level using the <b>Locale</b> object; and the various formatting methods for <b>Date</b>, <b>Calendar</b>, and <b>Number</b> data types. In the rare case where the JDBC driver must pass along locale sensitive data in a localized format, the proper formatter is used with the default JVM locale.</p>
    </content></div><h1 class="heading">Collation Support</h1><div id="sectionSection3" class="section"><content xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">
      <p xmlns="">The JDBC Driver 3.0 supports all the collations supported by SQL Server 2000, SQL Server 2005, and the new collations or new versions of Windows collation names introduced in SQL Server 2008.</p>
      <p xmlns="">For more information on the collations, see <a href="http://go.microsoft.com/fwlink/?LinkId=131366" target="_blank" alt=""><linkText xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">Collation and Unicode Support</linkText></a> and <a href="http://go.microsoft.com/fwlink/?LinkId=131367" target="_blank" alt=""><linkText xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5">Windows Collation Name (Transact-SQL)</linkText></a> in SQL Server Books Online.</p>
    </content></div><span id="seeAlsoSpan"><h1 class="heading">See Also</h1></span><div id="seeAlsoSection" class="section" name="collapseableSection"><a href="939a8773-2583-49a4-bf00-6b892fbe39dc.htm">Overview of the JDBC Driver</a><br /><br /></div><!--[if gte IE 5]>
			<tool:tip element="seeAlsoToolTip" avoidmouse="false"/><tool:tip element="languageFilterToolTip" avoidmouse="false"/><tool:tip element="roleInfoSpan" avoidmouse="false"/>
		<![endif]-->
      <div id="footer" class="section">
        
		<hr />
		
		<span id="fb" class="feedbackcss">
			
			
		</span>
		
		<a href="9bad553b-9e70-4696-8499-2e35f772a1e0.htm">
			
			© 2010 Microsoft Corporation. All rights reserved.
		</a>
 	
	
      </div>
    </div>
  </body>
</html>